#include <string.h>
#include <stdio.h>
 
int main () {
	int i = 0;
	int ii = 0;
   char f_buf[200] = {"bin,0x00000000,Blinky_fast.bin\r\n\
bin,0x00000000,Blinky_slow.bin\r\n\
bin,0x00000000,ev785B_boot.bin\r\n\
bin,0x00011800,EV785B_HV10_V01_2108031.bin\r\n\
sn,0x0003fc00,0x7b160001"};

   const char key[3] = "\r\n";
   const char key1[2] = ",";
   char *token;
   char *token1;
   char *p;
   char *p1;
   
        token = strtok_r((char *)f_buf, key, &p);
        while( token != NULL){
            printf("item %d is: %s\r\n", i++, token);
			token1 = strtok_r(token,key1,&p1);
			while(token1 != NULL){
				printf("token %d: %s\t",ii++, token1);
				token1 = strtok_r(NULL, key1, &p1);
			}
			ii = 0;
			printf("\r\n");
            token = strtok_r(NULL, key, &p);
        }
   
   return(0);
}
